package com.yanqu.road.entity.activity.twins.config;

import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class TwinsMissionConfig {

    int id;
    int type;
    String name;
    String recommendPower;
    String monsterId;
    String bossId;
    String monsterPower;
    String bossPower;
    String rewards;
    String sweepRewards;
    String sweepRandomRewards;
    String failRewards;
    int isBoss;
    int map;
    int energyCost;

    //总的按顺序的boss
    List<Integer> bossIdMap = new ArrayList<>();

    Map<Integer,List<Integer>> bossInfoMap = new ConcurrentHashMap();

    List<Integer> sweepRandomRewardsList = new ArrayList<>();
    List<String> sweepRandomRewardWeightList = new ArrayList<>();

    List<Long> recommendPowerList = new ArrayList<>();

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRecommendPower() {
        return recommendPower;
    }

    public void setRecommendPower(String recommendPower) {
        this.recommendPower = recommendPower;
        recommendPowerList = StringUtils.stringToLongList(recommendPower,";");
    }

    public List<Long> getRecommendPowerList() {
        return recommendPowerList;
    }

    public String getMonsterId() {
        return monsterId;
    }

    public void setMonsterId(String monsterId) {
        this.monsterId = monsterId;
        List<Integer> tempIdList = StringUtils.stringToIntegerList(monsterId,";");
        for(int bossId : tempIdList){
            if(bossId != 0){
                bossIdMap.add(bossId);
            }
        }
    }

    public String getBossId() {
        return bossId;
    }

    public void setBossId(String bossId) {
        this.bossId = bossId;
        bossIdMap.addAll(StringUtils.stringToIntegerList(bossId,";"));
    }

    public String getMonsterPower() {
        return monsterPower;
    }

    public void setMonsterPower(String monsterPower) {
        this.monsterPower = monsterPower;
        List<Integer> mIdList = StringUtils.stringToIntegerList(this.monsterId,";");
        List<String> infoStrList = StringUtils.stringToStringList(monsterPower,"\\|");
        for(int i = 0;i < infoStrList.size();i++){
            if(mIdList.get(i) != 0){
                List<Integer> infoIntList = StringUtils.stringToIntegerList(infoStrList.get(i),";");
                bossInfoMap.put(mIdList.get(i),infoIntList);
            }
        }
    }

    public String getBossPower() {
        return bossPower;
    }

    public void setBossPower(String bossPower) {
        this.bossPower = bossPower;
        List<String> bIdList = StringUtils.stringToStringList(this.bossId,"\\|");
        List<String> infoStrList = StringUtils.stringToStringList(bossPower,"\\|");
        for(int i = 0;i < infoStrList.size();i++){
            List<Integer> infoIntList = StringUtils.stringToIntegerList(infoStrList.get(i),";");
            bossInfoMap.put(Integer.valueOf(bIdList.get(i)),infoIntList);
        }
    }

    public String getRewards() {
        return rewards;
    }

    public void setRewards(String rewards) {
        this.rewards = rewards;
    }

    public Integer getBossId(int bossIndex) {
        return bossIdMap.get(bossIndex);
    }

    public List<Integer> getBossInfo(int bossId) {
        return bossInfoMap.get(bossId);
    }

    public List<Integer> getBossIdList() {
        return bossIdMap;
    }


    public String getSweepRewards() {
        return sweepRewards;
    }

    public void setSweepRewards(String sweepRewards) {
        if(!sweepRewards.equals("0")){
            this.sweepRewards = sweepRewards;
        }else{
            this.sweepRewards = "";
        }
    }

    public String getSweepRandomRewards() {
        return sweepRandomRewards;
    }

    public void setSweepRandomRewards(String sweepRandomRewards) {
        this.sweepRandomRewards = sweepRandomRewards;
        if(sweepRandomRewards.equals("0")){
            return;
        }
        List<String> tempStringList = StringUtils.stringToStringList(sweepRandomRewards,"\\|");
        for(String tempString : tempStringList){
            List<String> tempStringList2 = StringUtils.stringToStringList(tempString,";");
            sweepRandomRewardWeightList.add(tempStringList2.get(0));
            sweepRandomRewardsList.add(Integer.valueOf(tempStringList2.get(1)));
        }
    }

    public String getFailRewards() {
        return failRewards;
    }

    public void setFailRewards(String failRewards) {
        this.failRewards = failRewards;
    }


    public List<Integer> getSweepRandomRewardsList() {
        return sweepRandomRewardsList;
    }

    public List<String> getSweepRandomRewardWeightList() {
        return sweepRandomRewardWeightList;
    }

    public int getIsBoss() {
        return isBoss;
    }

    public void setIsBoss(int isBoss) {
        this.isBoss = isBoss;
    }

    public int getMap() {
        return map;
    }

    public void setMap(int map) {
        this.map = map;
    }

    public int getEnergyCost() {
        return energyCost;
    }

    public void setEnergyCost(int energyCost) {
        this.energyCost = energyCost;
    }
}
